package cn.butcher21.window;

import cn.butcher21.utils.BuildScene;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;

import java.io.File;

/**
 * butcher create in 2021/05/12/2:50
 */
public class MainWindow extends Application {
    private Stage stage;

    public MainWindow() throws Exception {
        stage = new Stage();
        start(stage);
        BuildScene.stages.put("mainStage", stage);
    }

    @Override
    public void start(Stage primaryStage) throws Exception {
        Parent root = FXMLLoader.load(getClass().getResource("../view/mainView.fxml"));
        primaryStage.setTitle("海澜之家-男人的衣柜");
        primaryStage.getIcons().add(new Image(new File("src/main/resources/hl.jpg").toURI().toString()));
        primaryStage.setScene(new Scene(root, 1400, 900));
        //primaryStage.show();
    }

    public Stage getStage() {
        return stage;
    }
}
